<?php

class Empeval_Methods_Data_Position {

	public $id;
	public $name;
	public $grade;
	public $lastModified;
	/**
	 *
	 * @var Empeval_Methods_Data_BonusGroup
	 */
	public $bonusGroup = null;

	public function __construct(EmpevalPositions $position, $withBonusGroup=false) {
		$this->id = $position->getId();
		$this->name = $position->getName();
		$this->grade = $position->getGrade();
		$this->lastModified = $position->getLastModified();
		if ($withBonusGroup && $position->getBonusGroups() instanceof EmpevalBonusGroups) {
			$this->bonusGroup = new Empeval_Methods_Data_BonusGroup($position->getBonusGroups());
		}
	}

}